home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / util2 / iuwcltls.lha / README
Text File  |  1995-09-05  |  8KB  |  205 lines

  1. These are a bunch of small shell programs I wrote in the last year.
  2. I wrote them because  a) I needed them and  b) similar commands (from
  3. AmiNet or elsewhere) were poorly written, had huge executables and/or
  4. came without source.
  5.  
  6. Requirements:
  7.     Except for the NOP command, AmigaOS 2.04 (V37.175) or higher is
  8.     required. The MATCH command requires pattern.library V5.0 (available
  9.     at ftp.informatik.uni-oldenburg.de, /pub/amiga/archive/dev/pattern.lha
  10.     All executables are "pure" and can be made resident.
  11.  
  12. Author:
  13.     Ingo Wilken
  14.     Bloherfelder Str. 72
  15.     26129 Oldenburg
  16.     Germany
  17.  
  18. Legal stuff:
  19.     All programs are Copyright (C) by Ingo Wilken.
  20.     Permission to use, copy, modify, and distribute this software and
  21.     its documentation for any purpose and without fee is hereby granted,
  22.     provided that the above copyright notice appear in all copies and that
  23.     both that copyright notice and this permission notice appear in supporting
  24.     documentation.  This software is provided "as is" without express or
  25.     implied warranty.
  26.  
  27.  
  28. Regards,
  29. Ingo
  30. --
  31. Ingo Wilken, CS Student, Univ.of Oldenburg, FRG | I'll admit dat I'm not one
  32. http://www.informatik.uni-oldenburg.de/~ingo/   | of da beautiful people, but
  33. E-mail: Ingo.Wilken@informatik.uni-oldenburg.de | I'm not as ugly as da spooks
  34. IRC: Nobody or TeaMan      Fido: 2/2426/2020.15 | dat hang 'round here.  -Snarf
  35.  
  36. --------------------------------------------------------------------------
  37.  
  38. EXEC
  39.     Template:
  40.         STACK/K/N,PRI=PRIORITY/K/N,IGNORE/K/N,SYSSHELL/S,CMD=COM=COMMAND/A/F
  41.  
  42.     Function:
  43.         Executes a command synchronously.  This is useful if you want to
  44.         run a command with a specific stack size or priority, but do not
  45.         want change them in the shell or write a script for it.
  46.         It is also useful for programs that execute commands in a way that
  47.         does not support all features of a shell.  For example, I use a
  48.         "make" clone where the I/O redirection does not work, and internal
  49.         commands of the shell cannot be used.  Wrapping the commands in an
  50.         EXEC fixes the problem.
  51.  
  52.     Options:
  53.         IGNORE <rc>     Ignore any returncode from the command upto <rc>.
  54.         PRIORITY <pri>  Run the command with priority <pri> instead of the
  55.                         current priority.
  56.         STACK <size>    Run the command with a stack of <size>.  It defaults
  57.                         to 4000 bytes if this option is not used.
  58.         SYSSHELL        Run the command in the system (boot) shell instead
  59.                         of the usershell.
  60.  
  61.  
  62. GETPUBSCREEN
  63.     Template:
  64.         DEFAULT/S
  65.  
  66.     Function:
  67.         Prints the name of the frontmost screen if it is a public screen,
  68.         else prints the name of the default public screen.
  69.  
  70.     Options:
  71.         DEFAULT         Print the name of the default public screen.
  72.  
  73.     Example:
  74.         Alias to run the XDME editor on the frontmost screen (if it is a
  75.         public screen).  Note that the substitution marks must be escaped
  76.         to prevent an immediate execution of the GETPUBSCREEN command.
  77.             alias e     run xdme pubscreen *`getpubscreen*` []
  78.  
  79.  
  80. GETVOLUME
  81.     Template:
  82.         DEVICE,NOREQ/S
  83.  
  84.     Function:
  85.         Prints the volume name of current directory, or of any device
  86.         or file.
  87.  
  88.     Options
  89.         NOREQ           Do not display a "Please insert volume..."
  90.                         requester if the device or volume is not mounted.
  91.  
  92.     Example:
  93.         getvolume           -> print current volume
  94.         getvolume pc0:      -> print name of volume in device pc0:
  95.         getvolume foo/bar   -> print name of volume the file is on
  96.  
  97.  
  98. LINES
  99.     Template:
  100.         FIRST/A/N,LAST/A/N,FROM,TO
  101.  
  102.     Function:
  103.         Extracts lines from from a text file.  Positive line number are
  104.         counted from the beginning of the file (first line is 1), negative
  105.         numbers from the end (last is -1).  The file arguments (FROM, TO) can
  106.         be omitted, in this case LINES reads from it's input stream and
  107.         writes to it's output stream.
  108.  
  109.         If lines numbers are counted from the end of the file, then the
  110.         utility must store some lines in a FIFO:
  111.             lines 10 20     => no FIFO, read & write one line at a time
  112.             lines 10 -200   => no FIFO until line 10, then uses a FIFO of
  113.                                199 lines [-(LAST+1) lines]
  114.             lines -500 -100 => FIFO size of 500 lines [-FIRST lines]
  115.         There is no limit to the length of a line, except that it must fit
  116.         into available RAM, and it's length into a LONG :-).
  117.  
  118.     Example:
  119.         lines 10 20 infile.txt outfile.txt
  120.             Copies line 10 to line 20 from infile.txt to outfile.txt.
  121.         lines 1 10 infile.txt outfile.txt
  122.             Copies the first 10 lines.
  123.         lines -10 -1 infile.txt outfile.txt
  124.             Copies the last 10 lines.
  125.         lines 2 -2 infile.txt outfile.txt
  126.             Copies everything except the first and the last line.
  127.         lines 10 -1 infile.txt outfile.txt
  128.             Copies from line 10 to the end of file (everything except
  129.             the first nine lines).
  130.         lines -3 -2 infile.txt outfile.txt
  131.             Copies the two lines before the last line (lines 2 and 3,
  132.             counted from the end)
  133.         lines 10 -7 infile.txt outfile.txt
  134.             Copies everything except the first nine and the last six lines.
  135.  
  136.  
  137. MATCH
  138.     Template:
  139.         STRING/A,PAT=PATTERN/A,NOCASE/S
  140.  
  141.     Function:
  142.         Tries to match a string to a pattern, sets a WARN returncode if
  143.         they do not match.
  144.  
  145.     Options:
  146.         NOCASE          Perform a case-insensitve match.
  147.  
  148.     Examples:
  149.         match Amiga A#?a            -> OK (0)
  150.         match Foo Bar               -> WARN (5)
  151.         match Amiga amiga           -> WARN (5)
  152.         match Amiga amiga nocase    -> OK (0)
  153.  
  154.  
  155. NOP
  156.     Template:
  157.         DUMMY/M
  158.  
  159.     Function:
  160.         Does nothing, always returns OK.  All arguments are ignored.
  161.  
  162.  
  163. SETRC
  164.     Template:
  165.         OK/S,WARN/S,ERROR/S,FAIL/S,RC=RESULT/N,RC2=RESULT2/N
  166.  
  167.     Function:
  168.         Does nothing but to set a returncode.  If none of the
  169.         OK/WARN/ERROR/FAIL/RESULT options is used, it checks
  170.         it's program name:
  171.             "ok", "warn", "error" or "fail":  same as the option
  172.             "true":     returncode 1
  173.             "false":    returncode 0
  174.                 These allow constructs like
  175.                     IF `true` ...
  176.                 in scripts.
  177.             anything else: returncode 0
  178.  
  179.     Options:
  180.         OK              Set an OK (0) returncode.
  181.         WARN            Set a WARN (5) returncode.  Overrides OK.
  182.         ERROR           Set an ERROR (10) returncode.  Overrides WARN.
  183.         FAIL            Set a FAIL (20) returncode.  Overrides ERROR.
  184.         RESULT <num>    Set a returncode of <num>.  Overrides FAIL.
  185.         RESULT2 <num>   Set the secondary result to <num>.  This is the
  186.                         error code used by the WHY command.  Note that
  187.                         WHY ignores this if the returncode is 0.
  188.  
  189.  
  190. TEE
  191.     Template:
  192.         FILE,APPEND/S,BUF=BUFFER/K/N
  193.  
  194.     Function:
  195.         This is a clone of the Unix 'tee' command.  It copies it's input
  196.         stream to it's output stream, and to a file or the shell window.
  197.  
  198.     Options:
  199.         APPEND          Append data to the file, instead of overwriting it.
  200.         BUFFER <n>      Use <n> 512byte buffers instead of the default 100.
  201.                         This option is ignored if tee-ing to an interactive
  202.                         stream (i.e. a console window), in this case only
  203.                         one block is buffered.
  204.  
  205.